<?php

/*
        id : 当前评论的id
    */
$id = $_POST["id"];

include "./mysql.php";

$sql = "DELETE FROM t_comments WHERE id = {$id}";

$result = $mysqli->query($sql);

if ($mysqli->affected_rows) {
    // 代表删除成功
    $arr = array("code" => 200, "msg" => "删除成功");
} else {
    // 代表删除失败
    $arr = array("code" => 404, "msg" => "删除失败");
}

echo (json_encode($arr));
